#!/bin/sh
set -e
update_binfmt() {
  # Check for update-binfmts
  command -v update-binfmts >/dev/null || return 0

  # Uninstall
  update-binfmts --unimport FEX-x86
  update-binfmts --unimport FEX-x86_64
}

if [ $(uname -m) = 'aarch64' ]; then
  update_binfmt
fi

# Remove FEXInterpreter hardlink
unlink /usr/bin/FEXInterpreter
